﻿'Concrete Agregado
Public Class AgregadoConcreto(Of T)
    Implements Agregado(Of T)

    Private _vector() As T

    Public Function CreateIterator() As Iterator(Of T) Implements Agregado(Of T).CreateIterator
        Return New IteratorConcreto(Of T)(_vector)
    End Function
    Public Sub add(obj As T) Implements Agregado(Of T).add
        If Not _vector Is Nothing Then
            ReDim Preserve _vector(UBound(_vector) + 1)
        Else
            ReDim Preserve _vector(0)
        End If
        _vector.SetValue(obj, UBound(_vector))

    End Sub

End Class
